﻿<html><head><title> Ajax</title>
</head><body><center />
<h1> Веб страница в контейнере DIV </h1>
<div id = 'info'>нннннн</div>
<script>


params = "url=oreilly.com";
request = new ajaxRequest();
request.open("POST", "http://dimok911.net63.net/urlpost.php", true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

request.onreadystatechange = function()
	{
		if (this.readyState == 4) 
		{
			if (this.status == 200) 
			{
				if (this.responseText != null)
				{
				document.getElementById('info').innerHTML = this.responseText
				}
				else 
				alert("error Ajax: нету данных")
			}
			else
			alert("error Ajax:" + this.statusText)
		}
		
		
	}
	
request.send(params);

function ajaxRequest()
{
var request = new XMLHttpRequest();
return request;
}
</script>
</body>
</html>












